package com.wg.msshopsp.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wg.msshopsp.entity.Collect;
import com.wg.msshopsp.mapper.CollectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CollectService extends ServiceImpl<CollectMapper, Collect> {
    @Autowired
    private CollectMapper collectMapper;

    public int countFanByShopId(Integer shopId) {
        return collectMapper.countFanByShopId(shopId);
    }

    public int isCollected(Integer userId, Integer shopId) {
        return collectMapper.isCollected(userId, shopId);
    }

    public int deleteByUserAndShop(Integer userId, Integer shopId) {
        return collectMapper.deleteByUserAndShop(userId, shopId);
    }

    public int insert(Integer userId, Integer shopId) {
        return collectMapper.insert(userId, shopId);
    }

}
